#pragma once

#include <memory.h>

#include "Tokenizer.hpp"
#include "BigInt.hpp"

namespace CPreProc
{
  enum ParsedNumberType
  {
    ParseNumRes_Invalid = -1,
    
    ParseNumRes_Int = 0,
    ParseNumRes_UInt = 1,
    ParseNumRes_LongInt = 2,
    ParseNumRes_ULongInt = 3,
    ParseNumRes_LongLongInt = 4,
    ParseNumRes_ULongLongInt = 5,

    ParseNumRes_Float,
  };

  class ParsedNumber
  {
  public:
    void set(ParsedNumberType type,unsigned int val)
    {
      this->type = type;
      as_int = val;
      is_big_int = false;
    }

    bool get_is_big_int() const
    {
      return is_big_int;
    }

    int get_as_int() const
    {
      return as_int;
    }

  private:
    ParsedNumberType type;
    bool is_big_int;

    union
    {
      unsigned int as_int;
    };
  };

  bool try_parse_number(Tokenizer &tokenizer,ParsedNumber &out);
}

